
function remove()
{

    var innereBreite;
    innereBreite= window.innerWidth;
    innereHoehe=window.innerHeight;

    if (innereBreite <= 768)
    {
        if (innereHoehe > innereBreite)
        {
                
            var link = document.getElementById('normal');
            link.parentNode.removeChild(link);
            var link = document.getElementById('smartphone');
            link.parentNode.removeChild(link);
        }
        else
        {    
            var link = document.getElementById('normal');
            link.parentNode.removeChild(link);
            var link = document.getElementById('smartphone_portrait');
            link.parentNode.removeChild(link);
        }
          
    }else
    {
        var link = document.getElementById('smartphone');
        link.parentNode.removeChild(link);
        var link = document.getElementById('smartphone_portrait');
        link.parentNode.removeChild(link);
            
            
    }//end if
}//end method


function rand (min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
}


function reloadWeek()
{
    innereBreite= window.innerWidth;
    breite = getCookie("breite");
    if (innereBreite!=breite)
    {
        // alert (breite + " - " + innereBreite);
        setCookie("breite",innereBreite,1);
   
        //alert (getCookie("breite"));
        window.location = ("week.xhtml?rand=" + rand(1000,9999));
    }
//end if
}//end function


function setCookie(parameter,value,exdays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate() + exdays);
    var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
    document.cookie=parameter + "=" + c_value;
}

function removeCookie(c_name)
{
    setCookie(c_name, "", 0);
    
}

function getCookie(c_name)
{
    var i,x,y,ARRcookies=document.cookie.split(";");
    for (i=0;i < ARRcookies.length;i++)
    {
        x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
        y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
        x=x.replace(/^\s+|\s+$/g,"");
        if (x==c_name)
        {
            return unescape(y);
        }
    }
}